package cn.holy.app.xcddt.database.dao;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;


import cn.holy.app.xcddt.domain.UserBean;

import static androidx.room.OnConflictStrategy.REPLACE;

/**
 * Created by xionghao on 2018/2/23.
 */
@Dao
public interface UserDao {
    @Insert(onConflict = REPLACE)
    void save(UserBean user);

    @Query("SELECT * FROM users limit 1")
    LiveData<UserBean> load();

    @Query("SELECT * FROM users limit 1")
    UserBean loadNormal();


    @Update
    void update(UserBean user);

    @Delete()
    void delete(UserBean user);
}
